package com.junbao.module.main;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.junbao.module.main.db.DataBindingActivity;
import com.junbao.module.main.kt.Person;

/**
 * author : Majunbao
 * github : https://github.com/MaJunBaox
 * time   : 2022/8/28 10:39 上午
 * desc   : 学习中心模块
 */
public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btnKotlin;
    private Button btnDatabinding;
    private Button btnMvvm;
    private Button btnLiveBus;
    private Button btnView;
    private Button btnJetpack;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btnKotlin = (Button) findViewById(R.id.btn_kotlin);
        btnDatabinding = (Button) findViewById(R.id.btn_databinding);
        btnMvvm = (Button) findViewById(R.id.btn_mvvm);
        btnLiveBus = (Button) findViewById(R.id.btn_live_bus);
        btnView = (Button) findViewById(R.id.btn_view);
        btnJetpack = (Button) findViewById(R.id.btn_jetpack);
        btnKotlin.setOnClickListener(this);
        btnDatabinding.setOnClickListener(this);
        btnMvvm.setOnClickListener(this);
        btnLiveBus.setOnClickListener(this);
        btnView.setOnClickListener(this);
        btnJetpack.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.btn_kotlin){
            startActivity(new Intent(this , KotlinActivity.class));
        }else if (view.getId() == R.id.btn_databinding){
            startActivity(new Intent(this , DataBindingActivity.class));
        }
    }
}